//
//  MYGIMSingleChatModel.swift
//  MYGrow
//
//  Created by 小火科技 on 2024/3/12.
//

import HandyJSON

class MYGIMSingleChatModel: HandyJSON {
    var message: [MYGIMSingleChatListModel] = []
    var info: MYGIMMessageListDetailModel = MYGIMMessageListDetailModel()
    var nextpage = false
    var data = MYGIMSingleChatListDataData()
    var lastMessage = MYGIMMessageListLastMessageModel()
    var localhost_id = 0
    var fastmessage: [MYGIMFastMessageModel] = []
    required init() {
    }
}

class MYGIMFastMessageModel: HandyJSON {
    var id = 0
    var user_id = 0
    var message_content = ""
    var create_time = 0
    
    required init() {
    }
}

class MYGIMSingleChatListModel: HandyJSON {
    var datetime = ""
    var data:[MYGIMSingleChatListData] = []
    required init() {
    }
}

class MYGIMSingleChatListData: HandyJSON {
    var id = 0
    var type = MYGIMMessageType.single
    var group_id = 0
    var session_id = 0
    var sender_id = 0
    var message: Any = ""
    var read_number = 0
    var status = 0
    var createtime = 0
    var deleteuser = ""
    var is_destruction = 0
    var userInfo = MYGIMMessageListPushUserModel()
    var friendship = 0
    var localhost_id: Int = 0
    var is_agree = 0
    
    var content: String {
        switch type {
        case .system,.card:
            if let message = message as? [String: Any] {
                return message["message"] as? String ?? ""
            }
        default:
            return message as? String ?? ""
        }
        
        return ""
    }
    
    required init() {
        
    }
}

class MYGIMSingleChatListDataMessage: HandyJSON {
    var remark = ""
    var group = 0
    var note = ""
    var source = ""
    var result = ""
    var method = ""
    var display_user = 0
    
    required init() {
    }
}

class MYGIMSingleChatListDataData: HandyJSON {
    var session_id = 0
    var page = 1
    var tokens = MYGIMSendTokenModel()
    
    required init() {
    }
}

class MYGIMReadApplyChatData: HandyJSON {
    
    var is_agree = 0
    var tokens:[String: Any] = [:]
    var identity = ""
    var message_id = 0
    var localhost_id = 0
    var session_id = 0
    var id = 0
    var createtime = 0
    
    required init() {
    }
    
}
